<?php
$count = 1;
while(true){
    echo $count."\r\n";
    file_put_contents('./queue.txt',$count."\r\n",FILE_APPEND);
    $count++;
    if($count > 10){
        break;
    }
    sleep(1);
}